<?php
/*
 * This page is for cards.
 */
$cards = true;
include 'all.php';
include '../../include/config.php';
?>

<?php include '../head.php'; ?>
<title>Cards</title>
<style>
    .bb th, .bb td{
        border-bottom:  1px #000000 dotted !important ;
    }
</style>
<body>
    <div id="wrapper">

        <?php include '../header_profile.php'; ?>
        <?php include '../menu_left.php'; ?>
        <div class="salus_bank_reg float_left">


            <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/user">
                <!--                    <div class="salus_bank_logo logo"></div>-->
                <img src="../../include/images/logo_sakusbank.png" width="104px;" height="60px;" />                
                <div class="down_arrow"></div>
            </a>

            <?php
            $getbaby = mysql_query("select * from salus_buy_product where FK_fa_user_id='" . $_COOKIE['gid'] . "' and product_id ='2'  ") or die(mysql_error());
            if (mysql_num_rows($getbaby) != 0) {
                ?>
                <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusbaby" >
                    <img src="../../include/images/baby.png" width="104px;" height="50px;" />
                </a>
            <?php }
            ?>
            <div class="clear"></div>





            <div class="clear"></div>

            <div class="float_right" style="width: 210px">



                <div class="float_right top_after_menu"><a><img onclick="PrintElem('#mainContent')" src="../../include/images/print.png" title="Print"/></a></div>

            </div>

            <div class="clear"></div>

            <style>
                .nm{
                    /*                    background-image: url('../../include/cards/header_box_little.png');                    */

                }
            </style>


            <div id="mainContent">
                <hr>                           

                <?php
                $mn = mysql_query("select * from salus_user_profile_detail where FK_fa_user_id = '" . $_COOKIE['gid'] . "' ") or die(mysql_error());
                while ($row = mysql_fetch_array($mn)) {
                    $name = $row['name'] . '&nbsp;' . $row['sur_name'];
                    $bd = $row['date_of_birth'];
                    $photo = $row['photo'];
                    $c1 = mysql_fetch_array(mysql_query("select name from fa_country where id='" . $row['country'] . "'")) or die(mysql_error());
                    $country = $c1[0];
                    $b1 = mysql_fetch_array(mysql_query("select Name from fa_blood_groups where id='" . $row['group'] . "'")) or die(mysql_error());
                    $bg = $b1[0];
                    $rel1 = mysql_fetch_array(mysql_query("select name from fa_religion where id ='" . $row['religion'] . "'")) or die(mysql_error());
                    $religion = $rel1[0];
                    $trans = $row['blood_transfusions'];
                    $organ = $row['organ_donor'];
                }


                $mn1 = mysql_query("select * from fa_user where id = '" . $_COOKIE['gid'] . "'") or die(mysql_error());
                while ($row1 = mysql_fetch_array($mn1)) {
                    $user = $row1['user_name'];
                }
                $pws = $_POST['pass'];
                $opn1 = $_POST['info1'];
                $opn2 = $_POST['info2'];
                ?>


                <form action="Cards.php" method="post"  >
                    <table>
                        <tr>
                            <td>Enter Your Password :</td>
                            <td><input type="password" name="pass" value="<?= $pws ?>" /></td>
                            <td><?php if ($pws == '') {
                    echo '<font color=red>* Please Fill Password</font>';
                } ?></td>
                        </tr>
                        <tr>
                            <td>Select Information 1 :</td>
                            <td>
                                <select name="info1">
                                    <option value="Blood Group : <?= $bg ?>" >Blood Group : <?= $bg ?></option>
                                    <option value="Religion : <?= $religion ?>">Religion : <?= $religion ?></option>
                                    <option value="Accept Transfusion : <?= $trans ?>">Accept Transfusion : <?= $trans ?></option>
                                    <option value="Accept Organ Donation : <?= $organ ?>">Accept Organ Donation : <?= $organ ?></option>
                                </select>
                            </td>
                            <td>
                                if any option is null, <br> then fill it from user profile.
                            </td>
                        </tr>
                        <tr>
                            <td>Select Information 2 :</td>
                            <td>
                                <select name="info2">
                                    <option value="Blood Group : <?= $bg ?>" >Blood Group : <?= $bg ?></option>
                                    <option value="Religion : <?= $religion ?>">Religion : <?= $religion ?></option>
                                    <option value="Accept Transfusion : <?= $trans ?>">Accept Transfusion : <?= $trans ?></option>
                                    <option value="Accept Organ Donation : <?= $organ ?>">Accept Organ Donation : <?= $organ ?></option>
                                </select>
                            </td>
                            <td>
                                if any option is null, <br> then fill it from user profile.
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><input type="submit" value="Insert Into Card" /> </td>
                        </tr>
                    </table>
                </form>



                <div class="crd" style="border: 1px #000066 solid; width: 240px; height: 155px; font-size: 10px; " >
                    <img src="../../include/cards/body_card-01.png"  />
                    <div style=" margin-left: 190px; margin-top: -145px;  " ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/storage/profile_photo/<?= $photo ?>" height="40" width="40" /></div>
                    <div class="head1" style="margin-left: 5px; margin-top: -26px;" ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/include/cards/header_box-little.png" width="150" height="10" /> </div> 
                    <div class="nm" style="margin-top: -14px; margin-left: 10px;"><?= $name ?></div> <!--  Full Name-->
                    <div class="head1" style="margin-left: 5px; margin-top: 5px;" ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/include/cards/header_box-little.png" width="60"  height="10" /> </div>
                    <div class="head1" style="margin-left: 70px; margin-top: -10px; " ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/include/cards/header_box-little.png" width="60"  height="10" /> </div>
                    <div style="margin-top: -13px; margin-left: 8px; "><?= $bd ?></div>
                    <div style="margin-top: -16px; margin-left: 70px; "><?= $country ?></div>
                    <div style=" height: 10px; width: 50px; margin-top: 30px; margin-left: 5px; " ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/include/cards/box_sms-01.png" height="10" width="100" /></div>
                    <div style=" height: 10px; width: 50px; margin-top: -10px; margin-left: 110px; " ><img src="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/include/cards/box_sms-01.png" height="10" width="100" /></div>
                    <div style=" margin-top: -13px; margin-left: 10px; " ><?= $user ?></div>
                    <div style=" margin-top: -15px; margin-left: 115px; " ><?php
                if ($pws == '') {
                    echo '<font color=red>Fill This Password Field</font>';
                } else {
                    echo $pws;
                }
                ?></div>
                    <div style=" margin-top: 0px; margin-left: 10px; width: 90px; " ><?= $opn1 ?></div>
                    <div style=" margin-top: -17px; margin-left: 110px; " ><?= $opn2 ?></div>                    
                </div>
                <br>
                <img src="../../include/cards/retro_card.png" />
            </div>            


        </div><!-- wrapper over    -->
        <?php
        include '../../include/config.php';
        include '../menu_right.php';
        ?>
</body>
</html>